<extend name='Index/index' />

<block name="main">
                <div class="bg-light lter b-b wrapper-md">
                    <h1 class="m-n font-thin h3">视频评论管理</h1>
                </div>
                <div class="wrapper-md">
                    <div class="panel panel-default">
                        <div class="table-responsive">
                            <table class="table table-striped b-t b-light">
                                <thead>
                                    <tr>
                                        <th>评论ID</th>
                                        <th>视频ID</th>
                                        <th>评论人ID</th>
                                        <th>评论人</th>
                                        <th>留言内容</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <volist name='data' id='v'>
                                    <tr>
                                        <td><{$v.comment_id}></td>
                                        <td><{$v.v_id}></td>
                                        <td><{$v.u_id}></td>
                                        <td><{$v.sender}></td>
                                        <td><{$v.sendTime}></td>
                                        <td>
                                         <a  id="<{$v.comment_id}>" class='btn btn-danger'>删除</a>
                                        </td>
                                    </tr>
                                    </volist>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
<script type="text/javascript">
    $(function(){
            $("a:contains('删除')").click(function(){
                var id = $(this).parents('tr').children('td').eq(0).html();
                // alert(id);
                // return false;
                $(this).parents('tr').remove();
                $.ajax({
                url:"<{:U('del')}>",
                type:"POST",
                data:{'comment_id':id},
                dataType:'json', 
                success: function(data){
                        if(data == 1){
                            alert('删除成功');
                        }else{
                            alert('删除失败');
                        }
                    }
                })
            })
        })
</script>
</block>
